<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<div id="sidebar">
		<!-- Please use this template for new links! -->
		<h:form>
			<ul class="nav nav-list">
				<li class="nav-header"><h:outputText
						value="#{strings['sidebar.user.title']}" /></li>
				<li><h:commandLink
						value="#{strings['sidebar.user.link.login']}" action="login"
						rendered="#{authenticationBean.currentUser == null}" /> <h:outputText
						id="logged_in_name"
						value="Eingeloggt als: #{authenticationBean.currentUser.username}"
						rendered="#{authenticationBean.currentUser != null}" /></li>
				<li><h:commandLink
						id="logoutLink"
						value="#{strings['sidebar.user.link.logout']}"
						actionListener="#{authenticationBean.logout}"
						rendered="#{authenticationBean.currentUser != null}" /></li>
			</ul>
			<ul class="nav nav-list">
				<li class="nav-header"><h:outputText
						value="#{strings['sidebar.actions.title']}" /></li>
				<li><h:commandLink value="#{strings['sidebar.home']}"
						action="index" /></li>
				<li><h:commandLink value="#{strings['sidebar.addTopic']}"
						action="addTopic"
						rendered="#{authenticationBean.currentUser != null}" /></li>
			</ul>
		</h:form>
		<!-- Please use this template for new links! -->

		<div id="topics" class="nav nav-list">
			<h:outputText value="#{strings['sidebar.topics.title']}"
				styleClass="nav-header" />
			<h:dataTable var="topic" value="#{topicBean.topics}"
				rendered="#{not empty topicBean.topics}">
				<h:column>
					<h:form>
						<li><h:graphicImage value="img/icons/#{topic.icon.fileName}"
								styleClass="topicImage" rendered="#{topic.icon != null}" /> <h:graphicImage
								value="img/icons/default.png" styleClass="topicImage"
								rendered="#{topic.icon == null}" /> <h:outputLink
								value="showPosts.jsf?id=#{topic.id}">#{topic.title}</h:outputLink>
						</li>
					</h:form>
				</h:column>
			</h:dataTable>
			<h:outputText value="#{strings['sidebar.topics.empty']}"
				rendered="#{empty topicBean.topics}" />
		</div>
	</div>
</ui:composition>
